class ProductInfo {
  ProductInfo({
    String? id,
    String? name,
    String? subName,
    num? oldPrice,
    num? price,
    num? type,
    num? addTimeSecond,
    num? addVipTime,
    String? gameId,
    String? gameComboId,
    num? expiryTime1,
    dynamic expiryTime,
    num? expiryTime2,
    num? gameBuyoutExpiryTime,
    this.orderNo = "",
    this.codeUrl = "",
  }) {
    _id = id;
    _name = name;
    _subName = subName;
    _oldPrice = oldPrice;
    _price = price;
    _type = type;
    _addTimeSecond = addTimeSecond;
    _addVipTime = addVipTime;
    _gameId = gameId;
    _gameComboId = gameComboId;
    _expiryTime1 = expiryTime1;
    _expiryTime = expiryTime;
    _expiryTime2 = expiryTime2;
    _gameBuyoutExpiryTime = gameBuyoutExpiryTime;
  }

  ProductInfo.fromJson(dynamic json) {
    _id = json['_id'];
    _name = json['name'];
    _subName = json['sub_name'];
    _oldPrice = json['old_price'];
    _price = json['price'];
    _type = json['_type'];
    _addTimeSecond = json['_add_time_second'];
    _addVipTime = json['_add_vip_time'];
    _gameId = json['game_id'];
    _gameComboId = json['gamecombo_id'];
    _expiryTime1 = json['_tmpt'];
    _expiryTime = json['expiryTime'];
    _expiryTime2 = json['_expiryt'];
    _gameBuyoutExpiryTime = json['_expirytgame'];
    orderNo = json['_order_no'] ?? "";
    codeUrl = json['_code_url'] ?? "";
  }

  String? _id;
  String? _name;
  String? _subName;
  num? _oldPrice;
  num? _price;
  num? _type;
  num? _addTimeSecond;
  num? _addVipTime;
  String? _gameId;
  String? _gameComboId;
  dynamic _expiryTime;
  num? _expiryTime1;
  num? _expiryTime2;
  num? _gameBuyoutExpiryTime;

  String orderNo = "";
  String codeUrl = "";

  ProductInfo copyWith({
    String? id,
    String? name,
    String? subName,
    num? oldPrice,
    num? price,
    num? type,
    num? addTimeSecond,
    num? addVipTime,
    String? gameId,
    String? gameComboId,
    num? expiryTime1,
    dynamic expiryTime,
    num? expiryTime2,
    num? gameBuyoutExpiryTime,
    String orderNo = "",
    String codeUrl = "",
  }) =>
      ProductInfo(
        id: id ?? _id,
        name: name ?? _name,
        subName: subName ?? _subName,
        oldPrice: oldPrice ?? _oldPrice,
        price: price ?? _price,
        type: type ?? _type,
        addTimeSecond: addTimeSecond ?? _addTimeSecond,
        addVipTime: addVipTime ?? _addVipTime,
        gameId: gameId ?? _gameId,
        gameComboId: gameComboId ?? _gameComboId,
        expiryTime1: expiryTime1 ?? _expiryTime1,
        expiryTime: expiryTime ?? _expiryTime,
        expiryTime2: expiryTime2 ?? _expiryTime2,
        gameBuyoutExpiryTime: gameBuyoutExpiryTime ?? _gameBuyoutExpiryTime,
        orderNo: orderNo,
        codeUrl: codeUrl,
      );

  String? get id => _id;

  String? get name => _name;

  String? get subName => _subName;

  num? get oldPrice => _oldPrice;

  num? get price => _price;

  num? get type => _type;

  num? get addTimeSecond => _addTimeSecond;

  num? get addVipTime => _addVipTime;

  String? get gameId => _gameId;

  String? get gameComboId => _gameComboId;

  num? get expiryTime1 => _expiryTime1;

  dynamic get expiryTime => _expiryTime;

  num? get expiryTime2 => _expiryTime2;

  num? get gameBuyoutExpiryTime => _gameBuyoutExpiryTime;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['_id'] = _id;
    map['name'] = _name;
    map['sub_name'] = _subName;
    map['old_price'] = _oldPrice;
    map['price'] = _price;
    map['_type'] = _type;
    map['_add_time_second'] = _addTimeSecond;
    map['_add_vip_time'] = _addVipTime;
    map['game_id'] = _gameId;
    map['gamecombo_id'] = _gameComboId;
    map['_tmpt'] = _expiryTime1;
    map['expiryTime'] = _expiryTime;
    map['_expiryt'] = _expiryTime2;
    map['_expirytgame'] = _gameBuyoutExpiryTime;
    map['_order_no'] = orderNo;
    map['_code_url'] = codeUrl;
    return map;
  }

  @override
  String toString() {
    return toJson().toString();
  }
}
